//
//  WZPHotCommentView.m
//  WZPItem
//
//  Created by 王王喆平 on 16/7/15.
//  Copyright © 2016年 UI. All rights reserved.
//

#import "WZPHotCommentView.h"
#import "WZPThemeItem.h"
#import "WZPCommentItem.h"
#import "WZPUserName.h"

@interface WZPHotCommentView()
@property (weak, nonatomic) IBOutlet UIView *voiceView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIButton *voiceBtn;
@property (weak, nonatomic) IBOutlet UILabel *totalLabel;


@end

@implementation WZPHotCommentView
-(void)setItem:(WZPThemeItem *)item{
   
    [super setItem:item];
    
   // 判断评论是不是音频
    if (item.commentView.content.length) {
        // 文本
        _voiceView.hidden = YES;
        _totalLabel.hidden = NO;
        _totalLabel.text = item.commentView.totalCotent;
        
    }else{
    // 音频
        _totalLabel.hidden = YES;
        _voiceView.hidden = NO;
        
        _nameLabel.text = [NSString stringWithFormat:@"%@",item.commentView.user.username];
        [_voiceBtn setTitle:item.commentView.voicetime
                   forState:UIControlStateNormal];
       

        
    }


}


@end
